package Lab07;

import Lab06.MyDate;


public class Exercise7_5 {
    public static void main(String[] args) {
        Person jack = new Person("Jack");
        Student tom = new Student("Tom");

        Employee jim = new Employee("Jim");
        Faculty mark = new Faculty("Mark");

        Staff susie = new Staff("Susie");
        susie.setTitle("director");
        System.out.println(jack);
        System.out.println(tom);
        System.out.println(jim);
        System.out.println(mark);
        System.out.println(susie);

    }
}

class Person {

    String name, address;
    int phoneNumber;
    String emailAddress;

    public Person(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Person " + name;
    }
}

class Student extends Person {
    public static final int FRESHMAN = 0;
    public static final int SOPHOMORE = 1;
    public static final int JUNIOR = 2;
    public static final int SENIOR = 3;

    private int classStatus;

    public Student(String name) {
        super(name);
    }

    public int getClassStatus() {
        return classStatus;
    }

    public void setClassStatus(int classStatus) {
        this.classStatus = classStatus;
    }

    @Override
    public String toString() {
        return "Student " + name;
    }
}

class Employee extends Person {
    String office;
    MyDate dateHired;
    int salary;

    public Employee(String name) {
        super(name);
    }

    @Override
    public String toString() {
        return "Employee " + name;
    }
}

class Faculty extends Employee {
    String officeHours;
    private int rank;
// 这样就是设置为constant，用不同的数字代表不同的职能
    public static final int LECTURER = 0;
    public static final int ASSISTANT_PROFESSOR = 1;
    public static final int ASSOCIATE_PROFESSOR = 2;
    public static final int PROFESSOR = 3;

    public Faculty(String name) {
        super(name);
    }

    public int getRank() {
        return rank;
    }

    public void setRank(int rank) {
        this.rank = rank;
    }

    @Override
    public String toString() {
        return "Faculty " + name;
    }
}

class Staff extends Employee {
    private String title;

    public Staff(String name) {
        super(name);
    }

    @Override
    public String toString() {
        return "Staff " + name + "'s title is " + title;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
}